﻿@model Ecommerce.Areas.Manager.Models.Product
@{
    ViewBag.Title = "Detail of product";
}

<p>
    @Html.ActionLink("Back to List", "Index")
    &nbsp;
    @Html.ActionLink("Edit", "Edit", new { ID = Model.ProductID })
    &nbsp;
    @Html.ActionLink("Delete", "Delete", new { id = Model.ProductID }, new { @class = "delLink" })</td>
</p>
<fieldset>
    <legend>Detail of product</legend>
    <table border="0">
        <tr>
            <td style="width: 130px">@Html.LabelFor(model => model.ProdName)</td>
            <td>: <b>@Html.DisplayFor(model => model.ProdName)</b></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Category.CategoryName)</td>
            <td>: <b>@Html.DisplayFor(model => model.Category.CategoryName)</b></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Price)</td>
            <td>: <b>@Html.DisplayFor(model => model.Price) $</b></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.ProductStatus)</td>
            <td>: <b>@Html.DisplayFor(model => model.StatusName)</b></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.ProductStatus)</td>
            <td>: <b>@Html.DisplayFor(model => model.StatusName)</b></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.LastUpdate)</td>
            <td>: <b>@Html.DisplayFor(model => model.LastUpdate)</b></td>
        </tr>
    </table>

    <fieldset style="padding-top: 10px;">
        <legend>@Html.LabelFor(model => model.Description)</legend>
        @Html.DisplayFor(model => model.Description)
    </fieldset>
    @if (ViewBag.ImgList != null)
    {
        <fieldset>
            <legend>Image List</legend>
            @foreach (var item in ViewBag.ImgList)
            {
                <img class="imageList" src="/Upload/prodImg/@item" />
            }
        </fieldset>
    }
</fieldset>
<script type="text/javascript">
    $(document).ready(function () {

        $(".delLink").click(function () {

            return confirm("Are you sure want to delete this product?");
        });
    });
</script>
